/*
 * @Author: Yang qiuyou wangyi168359476@163.com
 * @Date: 2024-07-26 11:15:02
 * @LastEditors: 武兴创 superjava@vip.qq.com
 * @LastEditTime: 2024-08-28 17:48:43
 * @FilePath: \SGFEM\DataStructure\FEM\Constraint\include\RJOINTData.h
 * @Description: RJOINT 单元数据
 *
 */

#pragma once
#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Element/ElementBase.h"
#include "DataStructure/Input/Solver/DOFDirections.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
/** @ RJOINT 单元数据
 *
 * 在重合节点上定义铰
 */
struct DECLSPEC RJOINTData : public ElementBase
{
    SG::DataStructure::Common::Id  m_masterNode = 0;  ///< 主节点
    SG::DataStructure::Common::Id  m_slaveNode  = 0;  ///< 从节点编号
    SG::DataStructure::Common::I64 m_masterDOFs = 0;  ///< 主自由度
    SG::DataStructure::Common::Id  m_domainId   = 0;

    /**
     * @brief 获取主自由度集
     *
     * 返回主自由度集的引用。
     *
     * @return 主自由度集的引用
     */
    SG::DataStructure::FEM::DofSet GetMasterDOFs () const;
    void                           SetMasterDOFs (const SG::DataStructure::FEM::DofSet& dofs);
};

bool operator== (const RJOINTData& a, const RJOINTData& b);
SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE